﻿<UserControl x:Class="TfsBugger.Controls.CheckInBuggerUi"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    MinHeight="300" MinWidth="726" 
    Loaded="OnControlLoaded">
	<UserControl.Resources>
		<ResourceDictionary Source="../DefaultStyles.xaml" />
	</UserControl.Resources>
	<DockPanel Height="Auto" Width="Auto" LastChildFill="True">
		<Border DockPanel.Dock="Top" HorizontalAlignment="Stretch" Background="{StaticResource LightBlueGlass}" BorderBrush="Gray" BorderThickness="1" Padding="3">
			<StackPanel Orientation="Horizontal" Width="Auto" Height="Auto">
				<TextBlock Text="Server:" Foreground="White" VerticalAlignment="Center" Margin="5"></TextBlock>
				<ComboBox Name="cboServers" Width="200" Style="{StaticResource Style_ComboBoxFlat}" SelectionChanged="OnSelectedSvrChanged"></ComboBox>
				<Button Style="{StaticResource Style_ToolbarButtonClear}" Click="OnConnectButtonClick">
					<TextBlock Text="Connect..." Foreground="White" />
				</Button>
				<Separator />
				<TextBlock Text="Project:"  Foreground="White" VerticalAlignment="Center" Margin="5"></TextBlock>
				<ComboBox Name="cboProjects" Style="{StaticResource Style_ComboBoxFlat}" Width="200" IsEnabled="False" SelectionChanged="OnSelectedProjChanged"></ComboBox>
				<Separator />
				<Button 
					Name="btnStart" 
					Style="{StaticResource Style_ToolbarButtonClear}" 
					IsEnabled="false" 
					Margin="5 0 5 0" 
					Click="OnStartButtonClick">
					<TextBlock Text="Start" Foreground="White" />
				</Button>
				<Button 
					Name="btnStop" 
					Style="{StaticResource Style_ToolbarButtonClear}"
					IsEnabled="false"  
					Margin="5 0 5 0" 
					Click="OnStopButtonClick">
					<TextBlock Text="Stop" Foreground="White" />
				</Button>
				<Rectangle 
					Name="rectSpinner" 
					Visibility="Hidden" 
					Width="2" 
					Height="20" 
					Stroke="White" 
					Fill="Blue" 
					Margin="30 0 0 0">
					<Rectangle.BitmapEffect>
						<OuterGlowBitmapEffect GlowColor="WhiteSmoke" Opacity="1" GlowSize="5" />
					</Rectangle.BitmapEffect>
					<Rectangle.RenderTransform>
						<RotateTransform 
							Angle="1" 
							CenterX="1" 
							CenterY="10">
						</RotateTransform>
					</Rectangle.RenderTransform>
					<Rectangle.Resources>
						<Storyboard x:Key="ProgressAnimation" RepeatBehavior="Forever">
							<DoubleAnimation 
								Name="ProgressAnimation" 
								Storyboard.TargetName="rectSpinner" 
								Storyboard.TargetProperty="RenderTransform.Angle"
								From="0" 
								To="360" 
								Duration="0:0:1">
							</DoubleAnimation>
						</Storyboard>
					</Rectangle.Resources>
				</Rectangle>
				<TextBlock 
					Name="lblBugStatus"
					Text="Bugging server for check-ins..." 
					Foreground="White" 
					Visibility="Hidden" 
					VerticalAlignment="Center" 
					Margin="10 0 0 0" />
			</StackPanel>			
		</Border>
		<!--<ToolBar DockPanel.Dock="Top">
			<ToolBar.Items>
				<TextBlock Text="Server:" VerticalAlignment="Center" Margin="5"></TextBlock>
				<ComboBox Name="cboServers" Width="200" SelectionChanged="OnSelectedSvrChanged"></ComboBox>
				<Button Margin="5" Click="OnConnectButtonClick">
					<TextBlock Text="Connect..." />
				</Button>
				<Separator />
				<TextBlock Text="Project:" VerticalAlignment="Center" Margin="5"></TextBlock>
				<ComboBox Name="cboProjects" Width="200" IsEnabled="False" SelectionChanged="OnSelectedProjChanged"></ComboBox>
				<Separator />
				<Button 
					Name="btnStart" 
					IsEnabled="false" 
					Margin="5 0 5 0" 
					Click="OnStartButtonClick">
					<TextBlock Text="Start" />
				</Button>
				<Button 
					Name="btnStop" 
					IsEnabled="false" 
					Margin="5 0 5 0" 
					Click="OnStopButtonClick">
					<TextBlock Text="Stop" />
				</Button>
				<Rectangle 
					Name="rectSpinner" 
					Visibility="Hidden" 
					Width="2" 
					Height="20" 
					Stroke="Gray" 
					Fill="Blue" 
					Margin="30 0 0 0">
					<Rectangle.RenderTransform>
						<RotateTransform 
							Angle="1" 
							CenterX="1" 
							CenterY="10">
						</RotateTransform>
					</Rectangle.RenderTransform>
					<Rectangle.Resources>
						<Storyboard x:Key="ProgressAnimation" RepeatBehavior="Forever">
							<DoubleAnimation 
								Name="ProgressAnimation" 
								Storyboard.TargetName="rectSpinner" 
								Storyboard.TargetProperty="RenderTransform.Angle"
								From="0" 
								To="360" 
								Duration="0:0:1">
							</DoubleAnimation>
						</Storyboard>
					</Rectangle.Resources>
				</Rectangle>
				<TextBlock 
					Name="lblBugStatus"
					Text="Bugging server for check-ins..." 
					Visibility="Hidden" 
					VerticalAlignment="Center" 
					Margin="10 0 0 0" />
			</ToolBar.Items>
		</ToolBar>-->
		<!--</ToolBarPanel>-->
		<ListView Name="lstCheckIns" DockPanel.Dock="Top">
			<ListView.Background>
				<LinearGradientBrush>
					<LinearGradientBrush.GradientStops>
						<GradientStop Offset="0" Color="WhiteSmoke"/>
						<GradientStop Offset="1" Color="White"/>
					</LinearGradientBrush.GradientStops>
				</LinearGradientBrush>
			</ListView.Background>
			<ListView.View>
				<GridView>
					<GridView.ColumnHeaderContainerStyle>
						<Style TargetType="GridViewColumnHeader">
							<Setter Property="Visibility" Value="Hidden" />
							<Setter Property="Height" Value="0" />
						</Style>
					</GridView.ColumnHeaderContainerStyle>
					<GridView.Columns>
						<GridViewColumn Width="{Binding ElementName=lstCheckIns, Path=ActualWidth}">
							<GridViewColumn.CellTemplate>
								<DataTemplate>
									<DockPanel HorizontalAlignment="Stretch">
										<Expander DockPanel.Dock="Top" BorderBrush="Gray" Width="Auto" HorizontalAlignment="Stretch">
											<Expander.Header>
												<StackPanel Orientation="Horizontal">
													<TextBlock Text="{Binding Path=ChangesetName}" FontWeight="Bold" />
													<TextBlock Text=" (" />
													<TextBlock Text="{Binding Path=Committer}" />
													<TextBlock Text=") " />
													<TextBlock Text="- " />
													<TextBlock Text="{Binding Path=ChangesetDate}" />
												</StackPanel>
											</Expander.Header>
											<Grid DataContext="{Binding}">
												<Grid.RowDefinitions>
													<RowDefinition />
													<RowDefinition />
													<RowDefinition />
													<RowDefinition />
												</Grid.RowDefinitions>
												<Grid.ColumnDefinitions>
													<ColumnDefinition Width="Auto" />
													<ColumnDefinition Width="Auto" />
												</Grid.ColumnDefinitions>

												<TextBlock Text="Comment:" Grid.Row="0" Grid.Column="0" VerticalAlignment="Top" HorizontalAlignment="Right" />
												<TextBlock Text="Check-In Notes:" Grid.Row="1" Grid.Column="0" VerticalAlignment="Top" HorizontalAlignment="Right" />
												<TextBlock Text="{Binding Path=Comment}" Grid.Row="0" Grid.Column="1" VerticalAlignment="Top" HorizontalAlignment="Left" />
												<TextBlock Text="{Binding Path=CheckinNote}" Grid.Row="1" Grid.Column="1" VerticalAlignment="Top" HorizontalAlignment="Left" />
												<TextBlock Text="Changes:" Grid.ColumnSpan="2" Grid.Row="2" Grid.Column="0" />
												<!--<ListView ItemsSource="{Binding Path=Changes}" Grid.ColumnSpan="2" Grid.Row="3" Grid.Column="0">
													<ListView.View>
														<GridView>
															<GridView.ColumnHeaderContainerStyle>
																<Style TargetType="GridViewColumnHeader">
																	<Setter Property="Visibility" Value="Hidden" />
																	<Setter Property="Height" Value="0" />
																</Style>
															</GridView.ColumnHeaderContainerStyle>
															<GridView.Columns>
																<GridViewColumn>
																	<GridViewColumn.CellTemplate>
																		<DataTemplate>
																			<TextBlock Text="{Binding}" />
																			</DataTemplate>
																	</GridViewColumn.CellTemplate>
																</GridViewColumn>
															</GridView.Columns>
														</GridView>
													</ListView.View>
												</ListView>-->
											</Grid>
										</Expander>
										<Separator DockPanel.Dock="Top" Margin="5" />
									</DockPanel>									
								</DataTemplate>
							</GridViewColumn.CellTemplate>
						</GridViewColumn>
					</GridView.Columns>
				</GridView>
			</ListView.View>
		</ListView>
	</DockPanel>
</UserControl>
